Skip to content

TokenStep 0.1.48: reduce background energy usage - #11

Merged
Backtthefuture merged 1 commit into
mainfrom
codex/tokenstep-energy-efficiency-0.1.48
Aug 7, 2026
Merged

TokenStep 0.1.48: reduce background energy usage#11
Backtthefuture merged 1 commit into
mainfrom
codex/tokenstep-energy-efficiency-0.1.48

Conversation

@Backtthefuture

Copy link
Copy Markdown
Owner

What changed

  • Add power-aware refresh scheduling: at least 15 minutes on AC and 30 minutes on battery or Low Power Mode.
  • Decouple usage collection, quota refresh, and Agent Work Rank refresh with independent TTLs.
  • Replace repeated full Codex cache rewrites with a per-session SQLite incremental cache and unchanged-source checkpoint.
  • Add safe cache migration, corruption recovery, periodic strong validation, and fork-anchor performance improvements.
  • Bump the app and packaging defaults to v0.1.48.

Why

TokenStep previously launched a relatively expensive collection subprocess every five minutes and repeatedly encoded and rewrote a large collector cache even when local usage had not changed. On large Codex histories this created visible periodic CPU, memory, disk-write, and battery pressure.

User impact

  • Background refresh uses substantially less CPU and disk I/O.
  • Foreground panels still refresh according to the configured freshness interval.
  • Token totals, model splits, daily distribution, and Agent activity accounting remain unchanged.
  • Existing caches migrate automatically; corrupt incremental state is rebuilt safely.

Validation

  • Codex cumulative, append, fork, rewrite, migration, and corruption-recovery fixtures passed.
  • CC Switch and usage recalibration migration fixtures passed.
  • Localization and language-refresh checks passed.
  • Full TokenStep app and helper compilation passed.
  • Frozen 7.1 GB history: 1,010 sessions / 62,392 records, zero accounting mismatches against a full rebuild.
  • Unchanged warm refresh: 98 ms, 24 MB peak RSS.
  • Active-session incremental refresh: 210 ms, 27 MB peak RSS, about 0.70 MB logical writes.
  • Full XCTest execution is left to GitHub Actions because the local CommandLineTools installation does not provide the XCTest module.

@Backtthefuture
Backtthefuture merged commit ef13871 into main Aug 7, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant